'use strict';

const Controller = require('egg').Controller;

class UsersController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }

  async login() {
    // 登陆注册一体化
    const data = await this.ctx.service.users.login({ ...this.ctx.request.body });
    this.ctx.body = data
  }
}

module.exports = UsersController;
